// ***********************************************************************
// Assembly         : MVC4Portal
// Author           : LJO+01 (Laurent Jordi)
// Created          : 06-05-2013
// Last Modified By : LJO+01 (Laurent Jordi)
// Last Modified On : 06-05-2013
// ***********************************************************************
// <copyright file="ContactUsFormController.cs" company="Copyright © Innovacall 2011">
//     Copyright (c) Copyright © Innovacall 2011. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using InnovaApp.Portals.MVC4Portal.Models.ViewModels.LayoutViewModels.CustomControllerViewModels;
using InnovaApp.Layers.DataLayer;
using InnovaApp.Layers.ResourcesLayer.Properties;
using System.Web.Security;
using InnovaApp.Layers.CommonLayer;
using InnovaApp.Layers.DomainLayer;

namespace InnovaApp.Portals.MVC4Portal.Controllers.ViewControllers.LayoutViewControllers.CustomControllers
{
    /// <summary>
    /// Class ContactUsFormController
    /// </summary>
    public class ContactUsFormController : _LayoutViewControllers_Base<ContactUsForm_ViewModel>
    {
        /// <summary>
        /// Initializes data that might not be available when the constructor is called.
        /// </summary>
        /// <param name="requestContext">The HTTP context and route data.</param>
        protected override void Initialize(System.Web.Routing.RequestContext requestContext)
        {
            base.eMethodBase = "InnovaApp.Portals.MVC4Portal.Controllers.ViewControllers.LayoutViewControllers.CustomControllers.ContactUsFormController";
            base.specificCssCollection = new string[] { "Views/ContactUsForm.css", string.Format(@"ClientComponents/KendoUI/kendo.{0}.min.css", PortalEnvironment.KendoUITheme.ToLower()) };
            base.specificJSCollection = null;
            base.dynamicJSCollection = new string[] { "/ScriptsG/ContactUsFormDynamic.js" };
            base.specificJqueryJSCollection = new string[] { "Views/ContactUsForm.js" };
            base.externalJs = null;
            base.externalCss = null;
            base.Initialize(requestContext);
        }
        /// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns>ActionResult.</returns>
        public ActionResult Index()
        {
            //Warning, folowing line must be removed if URLFriendlyMode used.
            string language = base.URLReferLanguage;
            base.LocalizeDynamicScript(language, (CurrentContact != null ? CurrentContact.FavoriteLanguage.Language : null));

            //ViewBag.Message = "Modify this template to kick-start your ASP.NET MVC application.";
            using (DataRepositories _dataContext = new DataRepositories())
            {
                base.InitView(
                    pageTitle: Resources.View_ContactUsForm_PageTitle,
                    openingMessage: string.Empty,
                    specificCssCollection: specificCssCollection,
                    specificJSCollection: specificJSCollection,
                    dynamicJSCollection: dynamicJSCollection,
                    specificJqueryJSCollection: specificJqueryJSCollection,
                    jsVariables: jsVariables,
                    externalJs: externalJs,
                    externalCss: externalCss,
                    metaToAdd: Meta,
                    _dataContext: _dataContext,
                    displayMenus: true,
                    language: language,
                    adminMode: false,
                    currentUser: Membership.GetUser(),
                    usesKendoUI: true,
                    jQueryUITheme: PortalEnvironment.JQueryUITheme,
                    kendoUITheme: PortalEnvironment.KendoUITheme
                    );
                /*
                 * INITIALIZE ContentData with elements from database
                 */
            }
            /*
             * INITIALIZE ContentData with elements not coming from database
             */

            return View(ContentData);
        }

    }
}
